package com.linghang.wusthelper.config;

import com.linghang.wusthelper.interceptor.LhAuthenticationIntercaptor;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class LhInterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(LhauthenticationIntercaptor())
                .addPathPatterns("/lhstudio/**");  //  拦截所有请求
    }

    @Bean
    public LhAuthenticationIntercaptor LhauthenticationIntercaptor(){
        return new LhAuthenticationIntercaptor();
    }
}
